<html>

<script type="text/javascript">



// addCmt  post 请求 测试
function t(){

// 	var postData = {
// 		    "cmtInfo": '{"comment":"cc","userid":11,"iconfid":22,"becmtuserid":33}'
//     };

// 	var postData = {
// 		    "userInfo": '{"userid":11,"followid":22}'
//     };

// 	var postData ={
// 			 "rpInfo":'{"rpcontent":"new rp content","userid":11,"rp_userid":22,"commentid":33 }'  
// 	 };
		
		 
    postData = (function(obj){ // 转成post需要的字符串.
        var str = "";
     
        for(var prop in obj){
            //if(typeof obj[prop] === 'object'){
                
             //   }else{
                	str += prop + "=" + obj[prop] + "&"
                //}
        }
        return str;
    })(postData);
		 
		var xhr = new XMLHttpRequest();
		 // testP
		xhr.open("POST", "http://localhost:88/webApp/yitu2.0/public/testP", true);
		xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
		xhr.onreadystatechange = function(){
		    var XMLHttpReq = xhr;
		    if (XMLHttpReq.readyState == 4) {
		        if (XMLHttpReq.status == 200) {
		            var text = XMLHttpReq.responseText;
		 
		            console.log(text);
		        }
		    }
		};
		xhr.send(postData);

}


t();

</script>
</html>